import 'package:flutter/material.dart';
import 'package:local_coffee/components/rgba.dart';
import 'package:local_coffee/components/hex.dart';

class RadiusBtn extends StatelessWidget {
  
  final bool isActive;
  final String text;
  final Function onPress;

  RadiusBtn(
    this.text,
    {
      this.isActive = false,
      this.onPress
    }
  );

  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: () => onPress == null ? () {} : onPress(),
      child: Container(
        width: 80,
        height: 30,
        margin: EdgeInsets.only(right: 10, bottom: 10),
        alignment: Alignment.center,
        decoration: BoxDecoration(
          border: Border.all(color: RGBA.rgbaccc0b4),
          borderRadius: BorderRadius.all(Radius.circular(15)),
          color: isActive ? RGBA.rgbaccc0b4 : HEX.hexfff
        ),
        child: Text(
          text,
          style: TextStyle(
            color: isActive ? HEX.hexfff : RGBA.rgbaccc0aa,
            fontSize: 14
          ),
        ),
      ),
    );
  }
 }